package com.RunAndHappy.q779178.server.service.impl;

import com.RunAndHappy.q779178.server.service.MecMsgService;
import com.RunAndHappy.q779178.utils.OSHIMonitorUtil;
import com.RunAndHappy.q779178.utils.SpringUtil;
import com.aizuda.monitor.OshiMonitor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MecMsgServiceImpl implements MecMsgService {

    @Override
    public Map<String, Object> watchService(){
        OSHIMonitorUtil oshiMonitorUtil=(OSHIMonitorUtil) SpringUtil.getBean("OSHIMonitorUtil");
        List<String> acquire = List.of("sysInfo","cpuInfo","diskInfoList","jvmInfo","memoryInfo",
                "allDiskUsePercent","processList","computerSystem","centralProcessor","hardwareAbstractionLayer");
        return oshiMonitorUtil.GetOSHIInfo(acquire);
    }
}
